<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../../print.css" type="text/css" media="print">
<meta content="RichTextField,com.riaidea.text.RichTextField,DYNAMIC,INPUT,autoScroll,html,lineHeight,version,caretIndex,content,contentLength,defaultTextFormat,numSprites,text,textLength,textfield,type,viewHeight,viewWidth,placeholderMarginH,placeholderMarginV,addPlugin,append,clear,exportXML,getSprite,importXML,insertSprite,isSpriteAt,replace,setSize" name="keywords">
<title>com.riaidea.text.RichTextField</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'RichTextField - RichTextField API Documentation';
				var baseRef = '../../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">RichTextField API</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../../all-classes.html')" href="../../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../all-classes.html')" href="../../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../index-list.html')" href="../../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../../index.html?com/riaidea/text/RichTextField.html&amp;com/riaidea/text/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;RichTextField</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a>&nbsp;| <a href="#constantSummary">Constants</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class RichTextField"); titleBar_setSubNav(true,true,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">com.riaidea.text</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class RichTextField</td>
</tr>
<tr>
<td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">RichTextField <img class="inheritArrow" alt="Inheritance" title="Inheritance" src="../../../images/inherit-arrow.gif"> flash.display.Sprite</td>
</tr>
</table>
<p></p>
  <p>RichTextField是一个基于TextField的图文混编的组件。</p>
  <p>众所周知，TextField可以用html的方式来插入图片，但无法有效控制图片的位置且不能实时编辑。RichTextField可以满足这方面的需求。</p>
  <p>RichTextField有如下特性：
  <br><ul>
  <li>在文本末尾追加文本和显示元素。</li>
  <li>在文本任何位置替换(删除)文本和显示元素。</li>
  <li>支持HTML文本和显示元素的混排。</li>
  <li>可动态设置RichTextField的尺寸大小。</li>
  <li>可导入和导出XML格式的文本框内容。</li>
  </ul></p>
  
  
  <p></p>
<br>
<span class="label">Example</span>
<br>下面的例子演示了RichTextField基本使用方法：
  <div class='listing'><pre>
  var rtf:RichTextField = new RichTextField();   
  rtf.x = 10;
  rtf.y = 10;
  addChild(rtf);

  //设置rtf的尺寸大小
  rtf.setSize(500, 400);
  //设置rtf的类型
  rtf.type = RichTextField.INPUT;
  //设置rtf的默认文本格式
  rtf.defaultTextFormat = new TextFormat("Arial", 12, 0x000000);

  //追加文本和显示元素到rtf中
  rtf.append("Hello, World!", [ { index:5, src:SpriteClassA }, { index:13, src:SpriteClassB } ]);
  //替换指定位置的内容为新的文本和显示元素
  rtf.replace(8, 13, "世界", [ { src:SpriteClassC } ]);</pre></div>
  
  
  <p></p>下面是一个RichTextField的内容的XML例子，你可以使用importXML()来导入具有这样格式的XML内容，或用exportXML()导出这样的XML内容方便保存和传输：
  <div class='listing'><pre>
  &lt;rtf&gt;
    &lt;text&gt;Hello, World!&lt;/text&gt;
    &lt;sprites&gt;
    &lt;sprite src="SpriteClassA" index="5"/&gt;
    &lt;sprite src="SpriteClassB" index="13"/&gt;
    &lt;/sprites&gt;
  &lt;/rtf&gt;</pre></div>
  <p></p>
<br>
<hr>
</div>
<a name="propertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Properties</div>
<table id="summaryTableProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#autoScroll">autoScroll</a> : Boolean<div class="summaryTableDescription">
   一个布尔值，指示当追加内容到RichTextField后是否自动滚动到最底部。
   </div>
</td><td class="summaryTableOwnerCol">RichTextField</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#caretIndex">caretIndex</a> : int<div class="summaryTableDescription">
   指定鼠标指针的位置。
   </div>
</td><td class="summaryTableOwnerCol">RichTextField</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#content">content</a> : String<div class="summaryTableDescription">[read-only]
   返回文本字段中的内容（包括显示元素的占位符）。
   </div>
</td><td class="summaryTableOwnerCol">RichTextField</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#contentLength">contentLength</a> : int<div class="summaryTableDescription">[read-only]
   返回文字字段中的内容长度（包括显示元素的占位符）。
   </div>
</td><td class="summaryTableOwnerCol">RichTextField</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#defaultTextFormat">defaultTextFormat</a> : TextFormat<div class="summaryTableDescription">
   指定文本字段的默认文本格式。
   </div>
</td><td class="summaryTableOwnerCol">RichTextField</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#html">html</a> : Boolean<div class="summaryTableDescription">
   一个布尔值，指示文本字段是否以HTML形式插入文本。
   </div>
</td><td class="summaryTableOwnerCol">RichTextField</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#lineHeight">lineHeight</a> : int<div class="summaryTableDescription">
   指示文本字段的显示元素的行高（最大高度）。
   </div>
</td><td class="summaryTableOwnerCol">RichTextField</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#numSprites">numSprites</a> : int<div class="summaryTableDescription">[read-only]
   返回RichTextField中显示元素的数量。
   </div>
</td><td class="summaryTableOwnerCol">RichTextField</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#placeholderMarginH">placeholderMarginH</a> : int<div class="summaryTableDescription">[write-only]
   指示显示元素占位符的水平边距。
   </div>
</td><td class="summaryTableOwnerCol">RichTextField</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#placeholderMarginV">placeholderMarginV</a> : int<div class="summaryTableDescription">[write-only]
   指示显示元素占位符的垂直边距。
   </div>
</td><td class="summaryTableOwnerCol">RichTextField</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#text">text</a> : String<div class="summaryTableDescription">[read-only]
   返回文本字段中的文本（不包括显示元素的占位符）。
   </div>
</td><td class="summaryTableOwnerCol">RichTextField</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#textfield">textfield</a> : TextField<div class="summaryTableDescription">[read-only]
   TextField实例。
   </div>
</td><td class="summaryTableOwnerCol">RichTextField</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#textLength">textLength</a> : int<div class="summaryTableDescription">[read-only]
   返回文字字段中的文本长度（不包括显示元素的占位符）。
   </div>
</td><td class="summaryTableOwnerCol">RichTextField</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#type">type</a> : String<div class="summaryTableDescription">
   指示RichTextField的类型。
   </div>
</td><td class="summaryTableOwnerCol">RichTextField</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#viewHeight">viewHeight</a> : Number<div class="summaryTableDescription">[read-only]
   返回RichTextField对象的可见高度。
   </div>
</td><td class="summaryTableOwnerCol">RichTextField</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#viewWidth">viewWidth</a> : Number<div class="summaryTableDescription">[read-only]
   返回RichTextField对象的可见宽度。
   </div>
</td><td class="summaryTableOwnerCol">RichTextField</td>
</tr>
</table>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#RichTextField()">RichTextField</a>()</div>
<div class="summaryTableDescription">
   构造函数。
   </div>
</td><td class="summaryTableOwnerCol">RichTextField</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#addPlugin()">addPlugin</a>(plugin:<a href="plugins/IRTFPlugin.html">IRTFPlugin</a>):void</div>
<div class="summaryTableDescription">
   为RichTextField增加插件。
   </div>
</td><td class="summaryTableOwnerCol">RichTextField</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#append()">append</a>(newText:String, newSprites:Array = null, autoWordWrap:Boolean = false, format:TextFormat = null):void</div>
<div class="summaryTableDescription">
   追加newText参数指定的文本和newSprites参数指定的显示元素到文本字段的末尾。
   </div>
</td><td class="summaryTableOwnerCol">RichTextField</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#clear()">clear</a>():void</div>
<div class="summaryTableDescription">
   清除所有文本和显示元素。
   </div>
</td><td class="summaryTableOwnerCol">RichTextField</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#exportXML()">exportXML</a>():XML</div>
<div class="summaryTableDescription">
   导出XML格式的RichTextField的文本和显示元素内容。
   </div>
</td><td class="summaryTableOwnerCol">RichTextField</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#getSprite()">getSprite</a>(index:int):DisplayObject</div>
<div class="summaryTableDescription">
   返回由参数index指定的索引位置的显示元素。
   </div>
</td><td class="summaryTableOwnerCol">RichTextField</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#importXML()">importXML</a>(data:XML):void</div>
<div class="summaryTableDescription">
   导入指定XML格式的文本和显示元素内容。
   </div>
</td><td class="summaryTableOwnerCol">RichTextField</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#insertSprite()">insertSprite</a>(newSprite:Object, index:int = -1, autoRender:Boolean = true, cache:Boolean = false):void</div>
<div class="summaryTableDescription">
   在参数index指定的索引位置（从零开始）插入由newSprite参数指定的显示元素。
   </div>
</td><td class="summaryTableOwnerCol">RichTextField</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#isSpriteAt()">isSpriteAt</a>(index:int):Boolean</div>
<div class="summaryTableDescription">
   指示index参数指定的索引位置上是否为显示元素。
   </div>
</td><td class="summaryTableOwnerCol">RichTextField</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#replace()">replace</a>(startIndex:int, endIndex:int, newText:String, newSprites:Array = null):void</div>
<div class="summaryTableDescription">
   使用newText和newSprites参数的内容替换startIndex和endIndex参数指定的位置之间的内容。
   </div>
</td><td class="summaryTableOwnerCol">RichTextField</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#setSize()">setSize</a>(width:Number, height:Number):void</div>
<div class="summaryTableDescription">
   设置RichTextField的尺寸大小（长和宽）。
   </div>
</td><td class="summaryTableOwnerCol">RichTextField</td>
</tr>
</table>
</div>
<a name="constantSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Constants</div>
<table id="summaryTableConstant" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Constant</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#DYNAMIC">DYNAMIC</a> : String = "dynamic"<div class="summaryTableDescription">[static]
   用于指定动态类型的RichTextField。
   </div>
</td><td class="summaryTableOwnerCol">RichTextField</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#INPUT">INPUT</a> : String = "input"<div class="summaryTableDescription">[static]
   用于指定输入类型的RichTextField。
   </div>
</td><td class="summaryTableOwnerCol">RichTextField</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#version">version</a> : String = "2.0.2"<div class="summaryTableDescription">[static]
   RichTextField的版本号。
   </div>
</td><td class="summaryTableOwnerCol">RichTextField</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="propertyDetail"></a>
<div class="detailSectionHeader">Property detail</div>
<a name="autoScroll"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">autoScroll</td><td class="detailHeaderType">property</td>
</tr>
</table>
<div class="detailBody">
<code>public var autoScroll:Boolean</code><p>
   一个布尔值，指示当追加内容到RichTextField后是否自动滚动到最底部。
   </p><p>The default value is <code>true</code>.</p>
</div>
<a name="caretIndex"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">caretIndex</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>caretIndex:int</code>&nbsp;&nbsp;[read-write]<p>
   指定鼠标指针的位置。
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get caretIndex():int</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set caretIndex(value:int):void</code>
<br>
</div>
<a name="content"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">content</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>content:String</code>&nbsp;&nbsp;[read-only]<p>
   返回文本字段中的内容（包括显示元素的占位符）。
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get content():String</code>
<br>
</div>
<a name="contentLength"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">contentLength</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>contentLength:int</code>&nbsp;&nbsp;[read-only]<p>
   返回文字字段中的内容长度（包括显示元素的占位符）。
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get contentLength():int</code>
<br>
</div>
<a name="defaultTextFormat"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">defaultTextFormat</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>defaultTextFormat:TextFormat</code>&nbsp;&nbsp;[read-write]<p>
   指定文本字段的默认文本格式。
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get defaultTextFormat():TextFormat</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set defaultTextFormat(value:TextFormat):void</code>
<br>
</div>
<a name="html"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">html</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var html:Boolean</code><p>
   一个布尔值，指示文本字段是否以HTML形式插入文本。
   </p><p>The default value is <code>false</code>.</p>
</div>
<a name="lineHeight"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">lineHeight</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var lineHeight:int</code><p>
   指示文本字段的显示元素的行高（最大高度）。
   </p><p>The default value is <code>0</code>.</p>
</div>
<a name="numSprites"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">numSprites</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>numSprites:int</code>&nbsp;&nbsp;[read-only]<p>
   返回RichTextField中显示元素的数量。
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get numSprites():int</code>
<br>
</div>
<a name="placeholderMarginH"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">placeholderMarginH</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>placeholderMarginH:int</code>&nbsp;&nbsp;[write-only]<p>
   指示显示元素占位符的水平边距。
   </p><p>The default value is <code>1</code>.</p>
<span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set placeholderMarginH(value:int):void</code>
<br>
</div>
<a name="placeholderMarginV"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">placeholderMarginV</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>placeholderMarginV:int</code>&nbsp;&nbsp;[write-only]<p>
   指示显示元素占位符的垂直边距。
   </p><p>The default value is <code>0</code>.</p>
<span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set placeholderMarginV(value:int):void</code>
<br>
</div>
<a name="text"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">text</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>text:String</code>&nbsp;&nbsp;[read-only]<p>
   返回文本字段中的文本（不包括显示元素的占位符）。
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get text():String</code>
<br>
</div>
<a name="textfield"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">textfield</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>textfield:TextField</code>&nbsp;&nbsp;[read-only]<p>
   TextField实例。
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get textfield():TextField</code>
<br>
</div>
<a name="textLength"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">textLength</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>textLength:int</code>&nbsp;&nbsp;[read-only]<p>
   返回文字字段中的文本长度（不包括显示元素的占位符）。
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get textLength():int</code>
<br>
</div>
<a name="type"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">type</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>type:String</code>&nbsp;&nbsp;[read-write]<p>
   指示RichTextField的类型。
   </p><p>The default value is <code>RichTextField.DYNAMIC</code>.</p>
<span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get type():String</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set type(value:String):void</code>
<br>
</div>
<a name="viewHeight"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">viewHeight</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>viewHeight:Number</code>&nbsp;&nbsp;[read-only]<p>
   返回RichTextField对象的可见高度。
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get viewHeight():Number</code>
<br>
</div>
<a name="viewWidth"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">viewWidth</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>viewWidth:Number</code>&nbsp;&nbsp;[read-only]<p>
   返回RichTextField对象的可见宽度。
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get viewWidth():Number</code>
<br>
</div>
<a name="constructorDetail"></a>
<div class="detailSectionHeader">Constructor detail</div>
<a name="RichTextField()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">RichTextField</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">constructor</td>
</tr>
</table>
<div class="detailBody">
<code>public function RichTextField()</code><p>
   构造函数。
   </p></div>
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="addPlugin()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">addPlugin</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public function addPlugin(plugin:<a href="plugins/IRTFPlugin.html">IRTFPlugin</a>):void</code><p>
   为RichTextField增加插件。
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">plugin</span>:<a href="plugins/IRTFPlugin.html">IRTFPlugin</a></code> &mdash; 要增加的插件。
   </td>
</tr>
</table>
</div>
<a name="append()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">append</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function append(newText:String, newSprites:Array = null, autoWordWrap:Boolean = false, format:TextFormat = null):void</code><p>
   追加newText参数指定的文本和newSprites参数指定的显示元素到文本字段的末尾。
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">newText</span>:String</code> &mdash; 要追加的新文本。
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">newSprites</span>:Array</code> (default = <code>null</code>)<code></code> &mdash; 要追加的显示元素数组，每个元素包含src和index两个属性，如：{src:sprite, index:1}。
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">autoWordWrap</span>:Boolean</code> (default = <code>false</code>)<code></code> &mdash; 指示是否自动换行。
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">format</span>:TextFormat</code> (default = <code>null</code>)<code></code> &mdash; 应用于追加的新文本的格式。
   </td>
</tr>
</table>
</div>
<a name="clear()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">clear</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function clear():void</code><p>
   清除所有文本和显示元素。
   </p></div>
<a name="exportXML()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">exportXML</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function exportXML():XML</code><p>
   导出XML格式的RichTextField的文本和显示元素内容。
   </p><p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>XML</code></td>
</tr>
</table>
</div>
<a name="getSprite()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">getSprite</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function getSprite(index:int):DisplayObject</code><p>
   返回由参数index指定的索引位置的显示元素。
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">index</span>:int</code></td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>DisplayObject</code></td>
</tr>
</table>
</div>
<a name="importXML()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">importXML</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function importXML(data:XML):void</code><p>
   导入指定XML格式的文本和显示元素内容。
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">data</span>:XML</code> &mdash; 具有指定格式的XML内容。
   </td>
</tr>
</table>
</div>
<a name="insertSprite()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">insertSprite</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function insertSprite(newSprite:Object, index:int = -1, autoRender:Boolean = true, cache:Boolean = false):void</code><p>
   在参数index指定的索引位置（从零开始）插入由newSprite参数指定的显示元素。
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">newSprite</span>:Object</code> &mdash; 要插入的显示元素。其格式包含src和index两个属性，如：{src:sprite, index:1}。
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">index</span>:int</code> (default = <code>-1</code>)<code></code> &mdash; 要插入的显示元素的索引位置。
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">autoRender</span>:Boolean</code> (default = <code>true</code>)<code></code> &mdash; 指示是否自动渲染插入的显示元素。
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">cache</span>:Boolean</code> (default = <code>false</code>)<code></code> &mdash; 指示是否对显示元素使用缓存。
   </td>
</tr>
</table>
</div>
<a name="isSpriteAt()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">isSpriteAt</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function isSpriteAt(index:int):Boolean</code><p>
   指示index参数指定的索引位置上是否为显示元素。
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">index</span>:int</code> &mdash; 指定的索引位置。
   </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Boolean</code></td>
</tr>
</table>
</div>
<a name="replace()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">replace</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function replace(startIndex:int, endIndex:int, newText:String, newSprites:Array = null):void</code><p>
   使用newText和newSprites参数的内容替换startIndex和endIndex参数指定的位置之间的内容。
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">startIndex</span>:int</code> &mdash; 要替换的起始位置。
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">endIndex</span>:int</code> &mdash; 要替换的末位位置。
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">newText</span>:String</code> &mdash; 要替换的新文本。
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">newSprites</span>:Array</code> (default = <code>null</code>)<code></code> &mdash; 要替换的显示元素数组，每个元素包含src和index两个属性，如：{src:sprite, index:1}。
   </td>
</tr>
</table>
</div>
<a name="setSize()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">setSize</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function setSize(width:Number, height:Number):void</code><p>
   设置RichTextField的尺寸大小（长和宽）。
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">width</span>:Number</code> &mdash; 宽度。
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">height</span>:Number</code> &mdash; 高度。
   </td>
</tr>
</table>
</div>
<a name="constantDetail"></a>
<div class="detailSectionHeader">Constant detail</div>
<a name="DYNAMIC"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">DYNAMIC</td><td class="detailHeaderType">constant</td>
</tr>
</table>
<div class="detailBody">
<code>public static const DYNAMIC:String = "dynamic"</code><p>
   用于指定动态类型的RichTextField。
   </p></div>
<a name="INPUT"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">INPUT</td><td class="detailHeaderType">constant</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static const INPUT:String = "input"</code><p>
   用于指定输入类型的RichTextField。
   </p></div>
<a name="version"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">version</td><td class="detailHeaderType">constant</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static const version:String = "2.0.2"</code><p>
   RichTextField的版本号。
   </p></div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright"> 
</center>
</div>
</body>
</html>
<!-- -->
